<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>菜单</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    }

    body {
      background-color: rgba(0, 0, 0, 0.5);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }


    /* 对话框 */
    .dialog {
      background-color: white;
      border-radius: 16px;
      padding: 0;
      max-width: 90%;
      width: 400px;
      max-height: 80vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      position: relative;
      z-index: 10;
    }

    /* 关闭按钮 */
    .close-btn {
      position: absolute;
      top: 15px;
      right: 15px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background-color: #E0E0E0;
      border: none;
      color: white;
      font-size: 16px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      z-index: 11;
    }

    .close-btn:hover {
      background-color: #B0B0B0;
      transform: scale(1.1);
    }

    /* 用户信息区域 */
    .user-section {
      padding: 25px 25px 20px;
      display: flex;
      align-items: center;
      gap: 15px;
      border-bottom: 1px solid #F0F0F0;
    }

    .user-avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: linear-gradient(135deg, #FFD600 0%, #FFC107 100%);
      display: flex;
      justify-content: center;
      align-items: center;
      color: #2196F3;
      font-weight: bold;
      font-size: 20px;
      box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
    }

    .user-info {
      flex: 1;
    }

    .user-name {
      font-size: 18px;
      font-weight: 600;
      color: #333;
      margin-bottom: 8px;
    }

    .logout-btn {
      background: white;
      border: 2px solid #2196F3;
      color: #2196F3;
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .logout-btn:hover {
      background: #2196F3;
      color: white;
      transform: translateY(-1px);
    }

    /* 菜单选项区域 */
    .menu-section {
      padding: 20px 25px;
    }

    .menu-item {
      display: flex;
      align-items: center;
      padding: 20px 0;
      border-bottom: 1px solid #F0F0F0;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .menu-item:last-child {
      border-bottom: none;
    }

    .menu-item:hover {
      background-color: rgba(33, 150, 243, 0.05);
      margin: 0 -25px;
      padding: 20px 25px;
      border-radius: 8px;
    }

    .menu-content {
      flex: 1;
    }

    .menu-title {
      font-size: 16px;
      font-weight: 600;
      color: #333;
      margin-bottom: 5px;
    }

    .menu-description {
      font-size: 13px;
      color: #666;
      line-height: 1.4;
    }

    .menu-arrow {
      color: #999;
      font-size: 16px;
      margin-left: 10px;
    }

    /* 底部链接区域 */
    .footer-section {
      padding: 20px 25px 25px;
      border-top: 1px solid #F0F0F0;
    }

    .footer-link {
      display: block;
      color: #333;
      text-decoration: none;
      font-size: 14px;
      margin-bottom: 15px;
      transition: color 0.3s ease;
    }

    .footer-link:hover {
      color: #2196F3;
    }

    .footer-link.blue {
      color: #2196F3;
    }

    .version {
      font-size: 12px;
      color: #999;
      text-align: center;
      margin-top: 15px;
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
      .dialog {
        width: 95%;
        max-width: 350px;
      }

      .user-section {
        padding: 20px 20px 15px;
      }

      .menu-section {
        padding: 15px 20px;
      }

      .footer-section {
        padding: 15px 20px 20px;
      }

      .menu-item {
        padding: 15px 0;
      }

      .menu-item:hover {
        margin: 0 -20px;
        padding: 15px 20px;
      }
    }
  </style>
</head>

<body>

  <!-- 对话框 -->
  <div class="dialog">
    <!-- 关闭按钮 -->
    <button class="close-btn" id="closeBtn">×</button>

    <!-- 用户信息区域 -->
    <div class="user-section">
      <div class="user-avatar">郭</div>
      <div class="user-info">
        <div class="user-name">guo dong</div>
        <button class="logout-btn" id="logoutBtn">登出</button>
      </div>
    </div>

    <!-- 菜单选项区域 -->
    <div class="menu-section">
      <div class="menu-item" id="contractItem">
        <div class="menu-content">
          <div class="menu-title">死后事务委托合同</div>
          <div class="menu-description">可以事先委托业者解除各种合同</div>
        </div>
        <div class="menu-arrow">→</div>
      </div>

      <div class="menu-item" id="willItem">
        <div class="menu-content">
          <div class="menu-title">遗嘱书</div>
          <div class="menu-description">可以按照自己的意愿处理财产的去向</div>
        </div>
        <div class="menu-arrow">→</div>
      </div>

      <div class="menu-item" id="guardianItem">
        <div class="menu-content">
          <div class="menu-title">任意后见人契约</div>
          <div class="menu-description">可以委托值得信赖的人管理手续等</div>
        </div>
        <div class="menu-arrow">→</div>
      </div>

      <div class="menu-item" id="assetItem">
        <div class="menu-content">
          <div class="menu-title">财产管理委托契约</div>
          <div class="menu-description">可以委托值得信赖的人管理财产</div>
        </div>
        <div class="menu-arrow">→</div>
      </div>
    </div>

    <!-- 底部链接区域 -->
    <div class="footer-section">
      <a href="#" class="footer-link" id="deleteAccount">注销账号</a>
      <a href="#" class="footer-link blue" id="termsPolicy">利用规则・隐私政策</a>
      <div class="version">Ver. 1.1.9(60)</div>
    </div>
  </div>

  <script>
    // 关闭按钮点击事件
    document.getElementById('closeBtn').addEventListener('click', function () {
      window.location.href = '主页.html';
    });

    // 登出按钮点击事件
    document.getElementById('logoutBtn').addEventListener('click', function () {
      if (confirm('确定要登出吗？')) {
        alert('已登出');
        window.location.href = '主页.html';
      }
    });

    // 菜单项点击事件
    document.getElementById('contractItem').addEventListener('click', function () {
      window.location.href = '死后事务委托合同详情页.html?from=menu';
    });

    document.getElementById('willItem').addEventListener('click', function () {
      window.location.href = '遗嘱书.html?from=menu';
    });

    document.getElementById('guardianItem').addEventListener('click', function () {
      alert('任意后见人契约功能');
    });

    document.getElementById('assetItem').addEventListener('click', function () {
      alert('财产管理委托契约功能');
    });

    // 底部链接点击事件
    document.getElementById('deleteAccount').addEventListener('click', function (e) {
      e.preventDefault();
      if (confirm('确定要删除注册信息吗？此操作不可撤销。')) {
        alert('注册信息已删除');
        window.location.href = '主页.html';
      }
    });

    document.getElementById('termsPolicy').addEventListener('click', function (e) {
      e.preventDefault();
      alert('利用規約・隐私政策');
    });

    // 点击背景关闭对话框
    document.addEventListener('click', function (e) {
      if (e.target === document.body) {
        window.location.href = '主页.html';
      }
    });

    // ESC键关闭对话框
    document.addEventListener('keydown', function (e) {
      if (e.key === 'Escape') {
        window.location.href = '主页.html';
      }
    });
  </script>
</body>

</html>